<?php
global $wpdb;
if(!isset($chartdata)) wp_die('');
!isset($chartdata) ? $chartdata = array() : '';
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['corechart']});
</script>
<script type="text/javascript">
  function drawVisualization() {
    var data = google.visualization.arrayToDataTable([
    	['Class', 'Study Result'],
    	<?php 
    	foreach ($chartdata as $charts)
		{
      	echo '["'.$charts['class'].'",'.$charts['result'].'],';
		}
    	?>
    ]);
    var options = {
      title : '<?php _e('Study result statitic','SEITCM')?>',
      vAxis: {title: "Study result", titleTextStyle: {color: 'red'}, minValue: 0, maxValue: 10},
      hAxis: {title: "Class", titleTextStyle: {color: 'red'}},
    };
    var chart = new google.visualization.ColumnChart(document.getElementById('seitcm_register_statistics'));
    chart.draw(data, options);
  }
  google.setOnLoadCallback(drawVisualization);
</script>
<div id="seitcm_register_statistics" style="min-height:300px"></div>